/**
 * By Alpha
 * Author: alixez <alixe.z@foxmail.com>
 * Date: 2017/12/11
 */

import React from 'react';
import PropTypes from 'prop-types';
import { Icon, Switch, Layout } from 'antd';

import { config } from 'utils';
import styles from './Layout.less';
import './Sider.less';
import Menus from './Menu';

class Sider extends React.Component {

  render () {
    const { collapsed, darkTheme, location, navOpenKeys, changeOpenKeys, menu } = this.props;
    const menusProps = {
      menu,
      collapsed,
      darkTheme,
      location,
      navOpenKeys,
      changeOpenKeys,
    };

    return (
      <Layout.Sider
        trigger={null}
        collapsible
        collapsed={collapsed}
      >
        <div className={styles.logo}>
          {collapsed ? <img alt={'logo'} src={config.logo} /> : <span>{config.name}</span>}
        </div>

        <Menus {...menusProps} />
      </Layout.Sider>
    );
  }
}

export default Sider;
